<template>
  <div class="shop">
    <!-- 面包屑 -->
    <el-bread></el-bread>
    <!-- 添加按钮 -->
    <el-button @click="getDialog" type="primary" plain>添加</el-button>
    <!-- 表格 -->
    <v-list @edit="edit"></v-list>
    <!-- dialog弹出框 -->
    <v-dialog ref="shopDialog" @cancel="cancel" :isShow="isShow" :isAdd="isAdd"></v-dialog>
  </div>
</template>
<script>
import vList from "./list.vue";
import vDialog from "./dialog.vue";
export default {
  data() {
    return {
      isShow: false,
      isAdd: true,
    };
  },
  components: { vList, vDialog },
  mounted() {},
  methods: {
    //点击添加按钮
    getDialog() {
      //显示dialog
      this.isShow = true;
      //证明你是进行添加操作
      this.isAdd = true;
    },
    cancel(){
        this.isShow = false
    },
    //表格的编辑按钮
    edit(e){
        //显示dialog
        this.isShow = true
        //是一个编辑按钮
        this.isAdd = false
        //点击编辑后数据回显
        this.$refs.shopDialog.lookup(e)
    }
  },
};
</script>
<style scoped>
</style>